package com.jq.aution.controller;

import com.jq.aution.controller.model.Shout;
import org.springframework.messaging.handler.annotation.MessageMapping;
import org.springframework.messaging.handler.annotation.SendTo;
import org.springframework.stereotype.Controller;

@Controller
public class WebSocketController {
    //当浏览器向服务器端发送STOMP请求时，通过@MessageMapping注解来映射/getServerTime地址
    @MessageMapping(value = "/getServerTime")
    @SendTo(value = "/topic/bidResponse")
    public Shout handleShout(Shout incoming){
        Shout outgoing=new Shout();
        outgoing.setMessage("hello");
        return outgoing;
    }
}
